package clock.bean;

import java.beans.*;

/**
 * <p>Titre : </p>
 * <p>Description : </p>
 * <p>Copyright : Copyright (c) 2003</p>
 * <p>Société : </p>
 * @author non attribué
 * @version 1.0
 */

public class ClockBeanBeanInfo extends SimpleBeanInfo {
    private Class beanClass = ClockBean.class;
    private String iconColor16x16Filename = "ClockIcon16.gif";
    private String iconColor32x32Filename = "ClockIcon32.GIF";
    private String iconMono16x16Filename = "ClockIcon16.gif";
    private String iconMono32x32Filename = "ClockIcon32.GIF";

    public ClockBeanBeanInfo() {
    }
    public PropertyDescriptor[] getPropertyDescriptors() {
        try {
            PropertyDescriptor _analog = new PropertyDescriptor("analog", beanClass, "isAnalog", "setAnalog");
            PropertyDescriptor _backImage = new PropertyDescriptor("backImage", beanClass, "getBackImage", "setBackImage");
            PropertyDescriptor _fontColor = new PropertyDescriptor("fontColor", beanClass, "getFontColor", "setFontColor");
            PropertyDescriptor _fontText = new PropertyDescriptor("fontText", beanClass, "getFontText", "setFontText");
            PropertyDescriptor _halfHourChime = new PropertyDescriptor("halfHourChime", beanClass, "getHalfHourChime", "setHalfHourChime");
            PropertyDescriptor _HHandColor = new PropertyDescriptor("HHandColor", beanClass, "getHHandColor", "setHHandColor");
            PropertyDescriptor _hourChime = new PropertyDescriptor("hourChime", beanClass, "getHourChime", "setHourChime");
            PropertyDescriptor _HPointColor = new PropertyDescriptor("HPointColor", beanClass, "getHPointColor", "setHPointColor");
            PropertyDescriptor _MHandColor = new PropertyDescriptor("MHandColor", beanClass, "getMHandColor", "setMHandColor");
            PropertyDescriptor _MPointColor = new PropertyDescriptor("MPointColor", beanClass, "getMPointColor", "setMPointColor");
            PropertyDescriptor _SHandColor = new PropertyDescriptor("SHandColor", beanClass, "getSHandColor", "setSHandColor");
            PropertyDescriptor _timeOut = new PropertyDescriptor("timeOut", beanClass, "getTimeOut", "setTimeOut");
            PropertyDescriptor[] pds = new PropertyDescriptor[] {
	            _analog,
	            _backImage,
	            _fontColor,
	            _fontText,
	            _halfHourChime,
	            _HHandColor,
	            _hourChime,
	            _HPointColor,
	            _MHandColor,
	            _MPointColor,
	            _SHandColor,
	            _timeOut};
            return pds;
        }
        catch(IntrospectionException ex) {
            ex.printStackTrace();
            return null;
        }
    }
    public java.awt.Image getIcon(int iconKind) {
        switch (iconKind) {
            case BeanInfo.ICON_COLOR_16x16:
              return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
            case BeanInfo.ICON_COLOR_32x32:
              return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
            case BeanInfo.ICON_MONO_16x16:
              return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
            case BeanInfo.ICON_MONO_32x32:
              return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
        }
        return null;
    }
    public BeanInfo[] getAdditionalBeanInfo() {
        Class superclass = beanClass.getSuperclass();
        try {
            BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
            return new BeanInfo[] { superBeanInfo };
        }
        catch(IntrospectionException ex) {
            ex.printStackTrace();
            return null;
        }
    }
}